]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
dnd: Handle dragActorSource getting destroyed
authorJonas Dreßler <verdre@v0yd.nl>
Sun, 10 Apr 2022 16:47:25 +0000 (18:47 +0200)
committerMarge Bot <marge-bot@gnome.org>
Fri, 24 Feb 2023 15:32:06 +0000 (15:32 +0000)
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2318>

js/ui/dnd.js

index 125024204c70495d9d8c69e27d89a8b37e34533c..63ce5a0201362eaaf69d86e5b259b65e9cb69fcd 100644 (file)
@@ -367,6 +367,10 @@ var _Draggable = class _Draggable extends Signals.EventEmitter {
                     y = stageY - this._dragActor.height / 2;
                 }
                 this._dragActor.set_position(x, y);
+
+                this._dragActorSourceDestroyId = this._dragActorSource.connect('destroy', () => {
+                    this._dragActorSource = null;
+                });
             } else {
                 this._dragActorSource = this.actor;
             }
@@ -799,6 +803,11 @@ var _Draggable = class _Draggable extends Signals.EventEmitter {
             this._dragOrigParent = null;
         }
 
+        if (this._dragActorSource) {
+            this._dragActorSource.disconnect(this._dragActorSourceDestroyId);
+            this._dragActorSource = null;
+        }
+
         this._dragState = DragState.INIT;
         currentDraggable = null;
     }